#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:p="http://primefaces.org/ui"
                 xmlns:x="http://xpert.com/faces"
                 >
    <h:form>
        <x:modalMessages/>
        <p:fieldset legend="${symbol_pound}{msg['dadosGerais']}">
            <div class="container-fluid">
                <div class="row">

                    <div class="form-group col-lg-6 col-md-6 col-sm-12 col-xs-12">
                        <h:outputLabel value="* ${symbol_pound}{msg['modeloEmail.assunto']}:" />
                        <p:inputText value="${symbol_pound}{modeloEmailMB.entity.assunto}" maxlength="255"  styleClass="form-control"  />
                    </div>

                </div>
                <div class="row">

                    <div class="form-group col-lg-6 col-md-6 col-sm-12 col-xs-12">
                        <h:outputLabel value="* ${symbol_pound}{msg['modeloEmail.tipoAssuntoEmail']}:" />
                        <h:selectOneMenu value="${symbol_pound}{modeloEmailMB.entity.tipoAssuntoEmail}" styleClass="form-control"    >
                            <f:selectItem itemLabel="${symbol_pound}{xmsg['select']}" />
                            <f:selectItems value="${symbol_pound}{findAllBean.get(classMB.tipoAssuntoEmail)}" 
                                           var="tipoAssuntoEmail"
                                           itemLabel="${symbol_pound}{tipoAssuntoEmail.descricao}"/>
                        </h:selectOneMenu>
                    </div>
                </div>
                <div class="row">

                    <div class="form-group col-lg-6 col-md-6 col-sm-12 col-xs-12">

                        <h:outputLabel value="* ${symbol_pound}{msg['modeloEmail.configuracaoEmail']}:" />
                        <h:selectOneMenu value="${symbol_pound}{modeloEmailMB.entity.configuracaoEmail}" converter="entityConverter" styleClass="form-control"  >
                            <f:selectItem itemLabel="${symbol_pound}{xmsg['select']}" />
                            <f:selectItems value="${symbol_pound}{findAllBean.get(classMB.configuracaoEmail)}" 
                                           var="configuracaoEmail"
                                           itemLabel="${symbol_pound}{configuracaoEmail}"/>
                        </h:selectOneMenu>
                    </div>

                </div>
            </div>
        </p:fieldset>
        <p:fieldset legend="${symbol_pound}{msg['modeloEmail.layout']}">

            <h:panelGroup id="panelLayout">

                <div class="container-fluid">
                    <div class="row">
                        <div class="form-group col-lg-12 col-md-6 col-sm-6 col-xs-12">

                            <h:panelGroup rendered="${symbol_pound}{empty viewScope.exibirTexto or viewScope.exibirTexto == false}" >
                                <p:editor value="${symbol_pound}{modeloEmailMB.entity.layout}" style="width: 100%;" width="700"/>
                            </h:panelGroup>

                            <h:panelGroup rendered="${symbol_pound}{viewScope.exibirTexto == true}" >
                                <p:inputTextarea autoResize="false" value="${symbol_pound}{modeloEmailMB.entity.layout}"  rows="10"
                                                 styleClass="form-control" />
                            </h:panelGroup>
                        </div>
                        <div class="form-group col-lg-12 col-md-12 col-sm-6 col-xs-12">
                            <div class="checkbox">
                                <label>
                                    <h:selectBooleanCheckbox value="${symbol_pound}{viewScope.exibirTexto}" id="exibirTexto">
                                        <p:ajax process="panelLayout" update="panelLayout"/>
                                    </h:selectBooleanCheckbox>
                                    Exibir editor de texto
                                </label>
                            </div>
                        </div>
                    </div>
                </div>

            </h:panelGroup>


        </p:fieldset>
        <h:outputText value="${symbol_pound}{xmsg['requiredFieldsForm']}"/>
        <div style="text-align: center;">
            <x:securityArea rolesAllowed="modeloEmail.create">
                <p:commandButton process="@form" update="@form" action="${symbol_pound}{modeloEmailMB.save}" value="${symbol_pound}{xmsg['save']}" />
            </x:securityArea>
            <x:securityArea rolesAllowed="modeloEmail.audit">
                <x:audit for="${symbol_pound}{modeloEmailMB.entity}"/>
            </x:securityArea>
        </div>
    </h:form>
</ui:composition>